﻿using System;
using System.Windows.Forms;
using System.Threading;

namespace LockScreen
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Boolean createdNew = false;
            using (Mutex mutex = new Mutex(true, "http://matz.cn/mutex/LockScreen", out createdNew))
            {
                if (createdNew)
                {
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    Application.Run(new MainHideForm());
                    mutex.ReleaseMutex();
                }
                else
                {
                    CoreHelper.DoExit();
                }
            }
        }
    }
}
